package com.webbei.Backstage.action;

import java.util.ArrayList;
import java.util.List;

import com.webbei.Backstage.service.BackstateSer;
import com.webbei.pojo.Carseries;
import com.webbei.pojo.Cartypes;

public class getThePicsByBrandIdAction {
	
	private BackstateSer bao;
	private int brandId;
	private List<Carseries> list;
	private List<Cartypes> cartypes;
	public String execute(){
		cartypes=new ArrayList<Cartypes>();
		//cartypes.addAll(c)
		list=bao.getAllCarSeriesByBrandId(brandId);
		for(Carseries s:list){
			System.out.println("sid:"+s.getSeriesId());
			cartypes.addAll(bao.getAllCarTypesBySeriesId(s.getSeriesId()));
		}
		System.out.println(cartypes.size());
		return "success";
	}
	public void setBao(BackstateSer bao) {
		this.bao = bao;
	}
	public int getBrandId() {
		return brandId;
	}
	public void setBrandId(int brandId) {
		this.brandId = brandId;
	}
	public List<Cartypes> getCartypes() {
		return cartypes;
	}
	public void setCartypes(List<Cartypes> cartypes) {
		this.cartypes = cartypes;
	}
	
	
}
